/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __37F9D32B_31F4_455b_BEDD_5E9BE1EF8F71__
#define __37F9D32B_31F4_455b_BEDD_5E9BE1EF8F71__

namespace xos_xml
{

    class mgr : public i_xml_mgr
    {
    public:
        typedef xos::release_impl< mgr > T;

    public:
        mgr();
        ~mgr();

    public:
        static int static_init( xos_container::i_container* pContainer, i_xml_mgr** ppv );
        static xos_container::i_container* container();
        static mgr* get();

    protected:
        int route_path( xos_xml::i_xml_node * pXmlNode, xos_box::i_variant * pParentNode, xos_box::i_variant ** ppCurNode );
        bool is_property( xos_xml::i_xml_node * pXmlNode );
        bool is_list( xos_xml::i_xml_node * pXmlNode );
        int init_data();

    public:
        int load_xml( const char * lpszFile, f_node lpfNode, f_value lpfValue, xos_box::i_variant ** ppvt );
        i_xml_node* node();
        i_xml_doc* doc();

    protected:
        f_value m_pfValue;
        f_node m_pfNode;

    public:
        int put_back_to_pool();
        int init();
        int term();

    };

} // xos_xml

#endif // __37F9D32B_31F4_455b_BEDD_5E9BE1EF8F71__
